package com.baor.dao;

import com.baor.domain.CarVo;
import com.github.yulichang.base.mapper.MPJJoinMapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

@Component
public interface CarDao extends MPJJoinMapper<CarVo> {


    List<CarVo> carList(Map<String,Object> params);
    Map<String,Object> findPageCount(Map<String,Object> params);
    List<Map<String,Object>> selectParking();
    List<Map<String,Object>> selectCooperate();
    @Select("select " +
                "car_id,car_master,car_tel,car_license,car_position,car_effective,car_sex,car_createtime," +
                "(select cooperate_name from t_cooperate b where b.cooperate_id = a.car_cooperate) as car_cooperate," +
                "(select parking_name from t_parking b where b.parking_id = a.car_parking) as car_parking " +
            "from t_car a where car_id = #{carId}")
    CarVo info(Integer carId);
}
